// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
import forgetPass from '@/views/forgetPass';
// 首页
import index from '@/views/index';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';
// 机器信息管理
import Machine from '@/views/machine/Machine';
// 功能设置
import Setting from '@/views/machine/Setting';
// 管理商品
import ManageGoods from '@/views/machine/ManageGoods';
//产品添加
import GoodsAdd from '@/views/machine/GoodsAdd';
// 商品分类
import GoodsClass from '@/views/machine/GoodsClass';
// 商品规格
import GoodsSpecs from '@/views/machine/GoodsSpecs';
// 商品参数
import GoodsParams from '@/views/machine/GoodsParams';
// 商品标签
import GoodsLabel from '@/views/machine/GoodsLabel';
// 商品评论
import GoodsReview from '@/views/machine/GoodsReview';
// 货道信息管理
import MachineAisle from '@/views/machine/MachineAisle';
// 产品参数
import Order from '@/views/machine/Order';
/**
 * 订单管理
 */
// 订单列表
import OrderList from '@/views/pay/OrderList';
// 订单详情
import OrderDetails from '@/views/pay/OrderDetails';
/**
 * 客户管理
 */
// 客户列表
import CustomerLists from '@/views/customer/CustomerLists';
// 客户详情
import CustomerDetails from '@/views/customer/CustomerDetails';
// 营销中心
import MarketingList from '@/views/marketing/MarketingList';
// 积分抵扣
import integral from '@/views/marketing/integral';
// 积分商城
import Integralmall from '@/views/marketing/Integralmall';
// 会员设置
import member from '@/views/marketing/member';
// 优惠券详情页面
import AddCoupon from '@/views/marketing/AddCoupon';

/**
 * 系统管理
 */
// 用户管理
import user from '@/views/system/user';
// 菜单管理
import Module from '@/views/system/Module';
// 角色管理
import Role from '@/views/system/Role';
// 公司管理
import Dept from '@/views/system/Dept';
// 系统环境变量
import Variable from '@/views/system/Variable';
// 权限管理
import Permission from '@/views/system/Permission';
/**
 * 支付管理
 */
// 支付配置信息
import MachineConfig from '@/views/machine/MachineConfig';
// 支付配置
import Config from '@/views/pay/Config';
/**
 * 数据监控
 */
// 监控查询
import druidLogin from '@/views/druid/login';

// 图表界面概况
import statistics from '@/views/charts/statistics';
// 数据
import statisticsData from '@/views/charts/statisticsData';
//修改个人信息
import modify from '@/views/modify';

//text
import text from '@/views/text/text';


// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/modify',
        name: 'modify',
        component: modify,
        meta: {
            requireAuth: true
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/forgetPass',
        name: '忘记密码',
        component: forgetPass,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/goods/Goods',
            name: '店铺管理',
            component: Goods,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/Machine',
            name: '机器信息管理',
            component: Machine,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/Setting',
            name: '功能设置',
            component: Setting,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/ManageGoods',
            name: '管理商品',
            component: ManageGoods,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/GoodsAdd',
            name: 'goodsadd',
            component: GoodsAdd,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/GoodsClass',
            name: '商品分类',
            component: GoodsClass,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/GoodsSpecs',
            name: '商品规格',
            component: GoodsSpecs,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/GoodsParams',
            name: '商品参数',
            component: GoodsParams,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/GoodsLabel',
            name: '商品标签',
            component: GoodsLabel,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/GoodsReview',
            name: '商品评论',
            component: GoodsReview,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/MachineAisle',
            name: '货道信息管理',
            component: MachineAisle,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/Order',
            name: '产品参数',
            component: Order,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/pay/OrderList',
            name: 'OrderList',
            component: OrderList,
            meta: {
                requireAuth: true
            }
        },{
            path: '/pay/OrderDetails',
            name: 'OrderDetails',
            component: OrderDetails,
            meta: {
                requireAuth: true
            }
        },{
            path: '/customer/CustomerLists',
            name: 'CustomerLists',
            component: CustomerLists,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/customer/CustomerDetails',
            name: 'CustomerDetails',
            component: CustomerDetails,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/Marketing/MarketingList',
            name: 'MarketingList',
            component: MarketingList,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Marketing/integral',
            name: '积分抵扣',
            component: integral,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Marketing/Integralmall',
            name: '积分商城',
            component: Integralmall,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Marketing/member',
            name: '会员设置',
            component: member,
            meta: {
                requireAuth: true
            }
        },{
            path: '/Marketing/AddCoupon',
            name: 'AddCoupon',
            component: AddCoupon,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/user',
            name: '用户管理',
            component: user,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Module',
            name: '菜单管理',
            component: Module,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Role',
            name: '角色管理',
            component: Role,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Dept',
            name: '公司管理',
            component: Dept,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Variable',
            name: '系统环境变量',
            component: Variable,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/system/Permission',
            name: '权限管理',
            component: Permission,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/machine/MachineConfig',
            name: '支付配置信息',
            component: MachineConfig,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/pay/Config',
            name: '支付配置',
            component: Config,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/druid/login',
            name: '监控查询',
            component: druidLogin,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statistics',
            name: 'statistics',
            component: statistics,
            meta: {
                requireAuth: true
            }
        }, {
            path: '/charts/statisticsData',
            name: 'statisticsData',
            component: statisticsData,
            meta: {
                requireAuth: true
            }
        }]
    }]
})